<?php
include_once 'inc/config.php';
include_once 'inc/mysql.class.php';
include_once 'smrty.php';
include_once 'fun/myfunction.php';
$mysql = new mysql();
$mysql->open($dbconfig);
if (isset($_GET['id'])) {
	//读取办事处数据
	$banshichu = $mysql->get_one("`id`,`listdeta`,`order_id`,`boxlist`","banshichu","`id`=$_GET[id]");
	//读取订单数据
	$order = $mysql->get_one("*","order","`id`=$banshichu[order_id]");
	$boxtrlist='';
	$boxlist = json_decode($banshichu['boxlist'],true);
	foreach ($boxlist as $value) {
		$munbers=munbertoint($value['munber']);
		$sum=$value['s']+$value['m']+$value['l']+$value['xl']+$value['xxl'];
		$boxtrlist .= "<tr height=\"30\" align=\"center\"><td>$value[munber]</td>";
		$boxtrlist .= "<td>$value[yanse]</td>";
		$boxtrlist .= "<td>$value[s]</td>";
		$boxtrlist .= "<td>$value[m]</td>";
		$boxtrlist .= "<td>$value[l]</td>";
		$boxtrlist .= "<td>$value[xl]</td>";
		$boxtrlist .= "<td>$value[xxl]</td>";
		$boxtrlist .= "<td>$munbers</td>";
		$boxtrlist .= "<td>x$sum</td>";
		$boxtrlist .= '<td>'.$munbers*$sum.'</td></tr>';
	}
	$smarty->assign('order',$order);
	$smarty->assign('boxtrlist',$boxtrlist);
	$smarty->display('box_list.html');
}else {
	echo '参数错误';
}
